#include<bits/stdc++.h>
using namespace std;

int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n; cin>>n;
    int ans=n;
    int cnt[100005]={0};
    for(int i=0; i<n; i++)
    {
        int a; cin>>a;
        cnt[a]++;
    }
    int weaker=0;
    for(int i=1; i<=100000; i++)
    {
        if(cnt[i]>weaker)
        {
            ans-=weaker;
            weaker=cnt[i];
        }
        else
            ans-=cnt[i];
    }
    cout<<ans<<endl;
    return 0;
}
